package com.yh.controller; /**
 * @Auther: Liang
 * @Date: 2024/4/28 - 04 - 28 - 21:41
 * @Description: ${PACKAGE_NAME}
 * @version: 1.0
 */

import com.yh.javabean.Teacher;
import com.yh.service.StudentService;
import com.yh.serviceimpl.StudentServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

@WebServlet(name = "indAllServlet", value = "/student/lookfindAllTeacher")
public class indAllServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");

        StudentService studentService =new StudentServiceImpl();
        ArrayList<Teacher> teachers = studentService.lookAllTeacher();
        PrintWriter writer = response.getWriter();
        writer.println(teachers);
    }

}
